<?php
namespace app\admin\controller;

class Common extends \think\Controller
{
    public function _initialize()
    {
        //验证登录代码
        if ( session('admin_id') == NULL)
        {	
        		session('url', $_SERVER['PHP_SELF']);
	        	$this->error("未登录",'admin/login/login');
   		}else{
            $admin_id = session('admin_id');
            $ret = db('admin')->where("admin_id={$admin_id}")->find();
            if($ret['admin_super']==1){
                $this->assign('is_super',1);
            }else{
                $this->assign('is_super',0);
            }
        }
    }

}
